package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.TypeInstructionBytecodeEvent;

public class TypeInstructionBytecodeEventImpl extends BytecodeEventImpl implements TypeInstructionBytecodeEvent
{
    private int opcode;
    private String typeName;

    public TypeInstructionBytecodeEventImpl(final int aOpcode, final String aTypeName) {
        opcode = aOpcode;
        typeName = aTypeName;
    }

    @Override
    public int getType() {
        return TYPE_INSTRUCTION;
    }

    @Override
    public void setOpcode(final int aOpcode) {
        opcode = aOpcode;
    }

    @Override
    public int getOpcode() {
        return opcode;
    }

    @Override
    public void setTypeName(final String aTypeName) {
        typeName = aTypeName;
    }

    @Override
    public String getTypeName() {
        return typeName;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeMethodVisitor().visitTypeInstruction(this);
        return aBytecodeVisitor;
    }
}
